### Create interdependent services

The following Dagger Function runs two services, service A and service B, that depend on each other. The services are set up with custom hostnames, `svca` and `svcb`, allowing each service to communicate with the other by hostname.

<Tabs groupId="language" queryString="sdk">
<TabItem value="go" label="Go">

```go file=../../../extending/modules/snippets/services/create-interdependent-services/go/main.go
```

</TabItem>
<TabItem value="python" label="Python">

```python file=../../../extending/modules/snippets/services/create-interdependent-services/python/main.py
```

</TabItem>
<TabItem value="typescript" label="TypeScript">

```typescript file=../../../extending/modules/snippets/services/create-interdependent-services/typescript/index.ts
```

</TabItem>
<TabItem value="php" label="PHP">

```php file=../../../extending/modules/snippets/services/create-interdependent-services/php/src/MyModule.php
```

</TabItem>
</Tabs>

#### Example

Start two inter-dependent services:

<Tabs groupId="shell">
<TabItem value="System shell">
```shell
dagger -c 'services | up --ports 8080:80'
```
</TabItem>
<TabItem value="Dagger Shell">
```shell title="First type 'dagger' for interactive mode."
services | up --ports 8080:80
```
</TabItem>
<TabItem value="Dagger CLI">
```shell
dagger call services up --ports 8080:80
```
</TabItem>
</Tabs>
